#import "ALSourceListAppVersionTextFieldCell.h"
#import "NSShadow+MCAdditions.h"


static NSDictionary *ALSourceListVersionTextFieldCellSelectedAttributes;
static NSDictionary *ALSourceListVersionTextFieldCellUnselectedAttributes;

@implementation ALSourceListAppVersionTextFieldCell

+(void)initialize {
	CGFloat fontSize = [NSFont smallSystemFontSize];
	NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
	[paragraphStyle setAlignment:NSLeftTextAlignment];
	[paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];
	NSShadow *textShadow = [[NSShadow alloc] mcInitWithColor:[NSColor colorWithCalibratedWhite:0.3f alpha:0.5f] offset:NSMakeSize(0, -1) blurRadius:1];
	ALSourceListVersionTextFieldCellSelectedAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont boldSystemFontOfSize:fontSize], NSFontAttributeName, [NSColor colorWithCalibratedWhite:0.8 alpha:1.0], NSForegroundColorAttributeName, textShadow, NSShadowAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil];
	ALSourceListVersionTextFieldCellUnselectedAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont systemFontOfSize:fontSize], NSFontAttributeName, [NSColor darkGrayColor], NSForegroundColorAttributeName, paragraphStyle, NSParagraphStyleAttributeName, nil];
}

-(NSDictionary *)normalAttributes {
	NSDictionary *attributes = [[NSDictionary alloc] initWithDictionary:ALSourceListVersionTextFieldCellUnselectedAttributes copyItems:YES];
	return attributes;
}

-(NSDictionary *)highlightedAttributes {
	NSDictionary *attributes = [[NSDictionary alloc] initWithDictionary:ALSourceListVersionTextFieldCellSelectedAttributes copyItems:YES];
	return attributes;
}

@end
